﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/TemplateUser.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="ManageBanking.Models" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
  <link href="../../Content/css/Stylesheet1.css" rel="stylesheet" type="text/css" />

    <script src="../../Scripts/functions.js" type="text/javascript"></script>

    <script src="../../Scripts/wysiwyg.js" type="text/javascript"></script>
    <script src="../../Scripts/smartpaginator.js" type="text/javascript"></script>

    <link href="../../Content/css/smartpaginator.css" rel="stylesheet" type="text/css" />
     <script src="../../Scripts/JTPS.js" type="text/javascript"></script>

   

    
    

    <link href="../../Content/css/screen.css" rel="stylesheet" type="text/css" />
 <%-- <link href="../../Areas/Admin/Content/css/screen.css" rel="stylesheet" type="text/css" />--%>
    <script type="text/javascript" language="javascript">

      $(document).ready(function() {
       
      $('#empTable').jTPS({clickCallback: function() {
              // target table selector
      var table = '#empTable';
              // store pagination + sort in cookie 
              document.cookie = 'jTPS=sortasc:' + $(table + ' .sortableHeader').index($(table + ' .sortAsc')) + ',' +
                                                'sortdesc:' + $(table + ' .sortableHeader').index($(table + ' .sortDesc')) + ';';
              $('.stubCell').remove();
          }
      });
          

          // reinstate sort and pagination if cookie exists
          var cookies = document.cookie.split(';');
          for (var ci = 0, cie = cookies.length; ci < cie; ci++) {
              var cookie = cookies[ci].split('=');
              if (cookie[0] == 'jTPS') {
                  var commands = cookie[1].split(',');
                  for (var cm = 0, cme = commands.length; cm < cme; cm++) {
                      var command = commands[cm].split(':');
                      if (command[0] == 'sortasc' && parseInt(command[1]) >= 0) {
                          $('#empTable .sortableHeader:eq(' + parseInt(command[1]) + ')').click();
                      } else if (command[0] == 'sortdesc' && parseInt(command[1]) >= 0) {
                          $('#empTable .sortableHeader:eq(' + parseInt(command[1]) + ')').click().click();
                      } 
                  }
              }
          }
          $('.stubCell').remove();
          // bind mouseover for each tbody row and change cell (td) hover style
          $('#empTable tbody tr:not(.stubCell)').bind('mouseover mouseout',
                                function(e) {
                                    // hilight the row
                                    e.type == 'mouseover' ? $(this).children('td').addClass('hilightRow') : $(this).children('td').removeClass('hilightRow');
                                }
                        );

      });

     
        </script>
        
    <script type="text/javascript">
        $(document).ready(function() {

            $("select#perpage").change(function() {
                var str;
                $("select option:selected").each(function() {
                    str = parseInt($(this).text());
                });


                $('#red').smartpaginator({ totalrecords: $('input#totaluser').attr('value'), recordsperpage: str, length: 4, datacontainer: 'empTable', dataelement: 'tr', next: 'Next', prev: 'Prev', first: 'First', last: 'Last', theme: 'black', controlsalways: true, onchange: function(newPage) {
                    $('#r').html('Page # ' + newPage);
                }
                });

                $('.short').remove();


            }).change();
        });
    </script>
     <script language="javascript" type="text/javascript">
         $(document).ready(function() {
             var count = $('#Count').attr("value");
             var check = $('#Check').attr("value");

             function hidden() {
                 for (var i = 0; i < count; i++) {

                     $('#input' + i).hide();
                     $('#submit-' + i).hide();
                     
                     $("#" + i).show();
                 }
             }

             hidden();
             $('.action').click(function() {
                 hidden();
                 var id = $(this).attr("id");

                 $("#" + id).hide();
                 $('#input' + id).show();
                 $('.delerror').attr("value", "");
                 $('#submit-' + id).show();

                 


             });
             $('.submit').click(function() {
                 var a = $(this).attr("id");
                 var spilt2 = a.split('-');

                 $("#" + spilt2[1]).show();
                 $('#input' + spilt2[1]).hide();
                 $('#submit-' + spilt1[1]).hide();
                 check = 0;
                 
             });
            



         });
    </script>
   <script type="text/javascript">
       $.fx.speeds._default = 1000;
       $(document).ready(function() {
           var d = $('#inputdem1').attr("value");
          
           for (var i = 0; i <= d; i++) {

               $('div#dialog' + i).dialog({
                   autoOpen: false,
                   show: 'blind',
                   hide: 'explode'
               });



           }
           $('.lock').click(function() {
               var id = $(this).attr("id");
               var substr = id.split('-');


               $('div#dialog' + substr[1]).dialog('open');
               return false;




           });



       });
        
	</script>    
      
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">


<%         
       
        List<ReceiveMoney> ac = (List<ReceiveMoney>)ViewData["info"];
        
        
         %>
         <% if (ViewData["ss"] == "true")
              {
                  %>
         <div class="succes">
					<div class="succes_icon"><!-- --></div>
					<a href="#" class="close" title="Close this notification">x</a>
					<div class="desc">
						<span>Success!</span>
						<p>Your Action Is Success</p>
					</div>
				</div>
				
    
				<div class="clear"><!-- --></div>   
				<%} %>
				<%else if (ViewData["ss"]!=null){ %>
				<div class="err">
					<div class="err_icon"><!-- --></div>
					<a href="#" class="close" title="Close this notification">x</a>
					<div class="desc">
						<span>Error!</span>
						<p><%=ViewData["ss"]%></p>
					</div>
				</div>
				<%} %>
   <table id="empTable" class="empTable3 empTable1" border="0"  cellpadding="0" cellspacing="0" >
	 <thead>
	<tr>
		<th sort="index" class="table-header-account th-idaccount"><a>ID Account From</a>	</th>
		
		
		<th sort="date" class="table-header-repeat line-left th-date"><a>Date Transfer</a></th>
		<th sort="Total" class="table-header-repeat line-left th-money"><a>Money</a></th>
		<th sort="Total" class="table-header-repeat line-left th-slove"><a>Solve</a></th>
		<th sort="Total" class="table-header-repeat line-left th-pass "><a>Pass</a></th>
		<th sort="description" class="table-header-options2 line-left th-option"><a>Options</a></th>
	</tr>
	</thead>
	  <tbody>
	   <input type="hidden" id='inputdem1' value='<%=ac.Count %>' />
	<%  int dem = 1;
        for (int i = 0; i < ac.Count; i++)
        {%>
                <% using (Html.BeginForm("ResolveReceive", "T_Account"))
                   {%>
	            <tr class="alternate-row">
		            <td id="open-<%= i %>" align="center" class="lock idacchover"><%=ac[i].IdAccountFrom%></td>
		        <%T_AccountModels ta = new T_AccountModels();

            Username us = ta.InforUser(ac[i].IdAccountFrom);
        
         %>
           <div id="dialog<%= i %>" title="Information User">
	                                <p>Name: <%=us.Name %></p>
	                                <p>Address: <%=us.Address %></p>
	                                <p>Birthday:<%=us.DateBirth.Value.ToString("yyyy-MM-dd") %></p>
	          
	                                
          </div>
            
		 
		 
		            <td align="center" class="lock"><%=ac[i].DateCreation.Value.ToString("yyyy-MM-dd")%></td>
		           <td align="center">$<%= ac[i].Money.Value.ToString("#,## ;#.##0.00'-';0 ")%></td>
		            <td align="center" class="lock">
		            <%=ac[i].Solve%>    
                     
		            </td>
		     <input id="Count" type="hidden" value="<%=ac.Count %>"/>
             <input id="Check" type="hidden" value="0"/>
		            <input id="Hidden1" type="hidden" name="idtrans" value="<%=ac[i].IdTransfer %>" />
		            <td align="center" class="lock">
		            <label id='<%=i %>' class="action " >Click Input Pass</label>
                    <input id='input<%=i %>'  type="password" name="pass" class="inputpass" />   
                     
		            </td>
		            <td class="options-width lock" >
                        
                        <input id='submit-<%=i %>' type="submit"  value="" class="icon-1 phuc5 submit" title="Update">
                        
		            </td>
		            <%} %>
	            </tr>
	        
	            
	<%  
        }
	     %>
	       </tbody>
	</table>
	<!--  end product-table................................... --> 
	

    <!--  start paging..................................................... -->
	<div id="red" style="margin: auto;">
	     <input id="totaluser" type="hidden" value='<%= ViewData["total"]%>'  />
	</div>
	
	<div id="drop" >
	    <select id="perpage" >   
            <option value="2">2</option>
			<option selected="selected" value="5">5</option>
			<option value="10">10</option>
			<option value="15">15</option>
			<option value="20">20</option>
			<option value="30">30</option>
		</select>
	</div>
	<!--  end paging................ -->
 

</asp:Content>
